package IO;

import java.io.IOException;
import java.io.StringReader;

public class StringReaderTest {
    public static void main(String[] args) throws IOException {
        StringReader reader = new StringReader("你好,world!");
        int data;
        //read()方法每次从流中读取一个字符,结尾返回-1
        while ((data = reader.read()) != -1) {
            System.out.print((char) data);
        }
        reader.close();
    }
}
